import { Cache } from "../../cache/Cache";
import { AIManager } from "../../scene/ai/AIManager";
import { AIType } from "../../scene/ai/AIType";
import { GTextFormat } from "../../../common/GTextFormat";
import { GlobalStyle } from "../../../common/global/GlobalStyle";
import { GLoadedButton } from "../../../../com/mui/controls/GLoadedButton";
import { FontUtil } from "../../../common/font/FontUtil";
import { SPublicMiniPlayer } from "../../../../Message/Public/SPublicMiniPlayer";
import { TaskProcessPanel } from "../task/imgtxt/TaskProcessPanel";
import { TaskTargetInfo } from "../../model/TaskTargetInfo";
type int = number;
//class LoveTaskBaseBody
    
    export  class LoveTaskBaseBody /* flash.display.Sprite */
    {
        constructor()
        {
            
            this.initUI();
            return;
        }

        protected onTitleTxtLinkHandler(arg1: Object /* flash.events.Event */): void
        {
            this.gotoRandomPoint(false);
            return;
        }

        protected onFlyGotoHandler(): void
        {
            this.gotoRandomPoint(true);
            return;
        }

        protected gotoRandomPoint(arg1: Boolean=false): void
        {
            this._target = Cache.instance.loveTask.sceneEffectTarget.clone(this._target);
            this._target.x = this._target.x + (Math.random() * 2 - 1) * 10;
            this._target.y = this._target.y + (Math.random() * 2 - 1) * 10;
            if (arg1) 
            {
                AIManager.onAIControl(this._target, AIType.AI_Convey);
            }
            else 
            {
                AIManager.onAutoPathAIControl(this._target);
            }
            return;
        }

        protected initUI(): void
        {
            this._textFormat = new GTextFormat("", 12, GlobalStyle.color1Uint);
            this._textFormat.letterSpacing = 2;
            this._textFormat.leading = 4;
            this.updateWH();
            return;
        }

        protected updateWH(): void
        {
            x = (this.bgW - this.width) / 2;
            y = (this.bgH - this.height) / 2;
            return;
        }

        protected setMarryBtnStyle(arg1: GLoadedButton): void
        {
            var loc1=new GTextFormat(FontUtil.songtiName, 12, 16776960);
            var loc2=new GTextFormat(FontUtil.songtiName, 12, 16776960);
            arg1.setStyle("textFormat", loc1);
            arg1.setStyle("disabledTextFormat", loc2);
            return;
        }

        public updateData(arg1: Array<any>=null): void
        {
            this.dispose();
            return;
        }

        public addInvite(arg1: SPublicMiniPlayer): void
        {
            return;
        }

        public delInviteView(arg1: SPublicMiniPlayer): void
        {
            return;
        }

        public updateFreeCount(): void
        {
            return;
        }

        public updatePanelType(arg1: Boolean): void
        {
            return;
        }

        public dispose(): void
        {
            return;
        }

        public get bgW(): int
        {
            return 512;
        }

        public get bgH(): int
        {
            return 290;
        }

        public /* override */ get width(): number
        {
            return 440;
        }

        public /* override */ get height(): number
        {
            return 215;
        }

        protected /* var */_titleTxt: Object /* flash.text.TextField */;

        protected /* var */_bodyImg: TaskProcessPanel;

        protected /* var */_textFormat: Object /* flash.text.TextFormat */;

        protected /* var */_target: TaskTargetInfo;
    }
